<template>
    <div id="road" @click="change"
      :style="log == 0 ? 'background-color:rgb(245, 245, 245)' : 'background-color: rgba(13, 13, 13, 0.8)'">事故统计</div>
    <div id="login-box" :style="log == 0 ? 'display:none' : 'display:block;zIndex:40'">
      
        <div class='g2-chart'>
            <div class="people-sum">石家庄市事故等级统计</div>
            <PieChart v-bind="BusOnlineConfig"  />
        </div>
        <div class='g2-chart'>
            <div class="people-sum">石家庄市事故类型统计</div>
             <ColumnChart v-bind="config" :data="data" />
        </div>
        <p id="close" @click="close">×</p>
      
    </div>
  </template>
    
  <script setup>
  import { applyFilter } from '@turf/turf';
  import { ref, computed } from 'vue'
  import { ColumnChart, RoseChart, PieChart } from "@opd/g2plot-vue";
  import { usetype} from '../Hook/eventtype'
  const {data, config}=usetype()
import {uselevel} from "../Hook/eventlevel"
const { config: BusOnlineConfig, data: BusOnlineData } = uselevel();
//const { bus_config, bus_data } = eventlevel();

  const log = ref(0);
  let active = ref()

  
  const change = () => {
    if (log.value == 0) {
      log.value = 1
    } else {
      log.value = 0
    }
  }

  
  
  const close = () => {
    log.value = 0;
  }
  
  </script>
  <style scoped>
  #road {
    height: 100%;
    width: 150px;
    font-size: 25px;
    color: grey;
    line-height: 80px;
    border-left: 1px solid;
    border-color: gray;
    padding-left: 7px;
    padding-right: 7px;
    align-items: center;
    display: flex;
    justify-content: center;
  
  }
  
  #login-box {
    padding: 20px;
    display: none;
    width: 700px;
    height: 700px;
    display: flex;
    border-radius: 5px;
    position: absolute;
    background-color: #a8a8a8;
    background-image: linear-gradient(0deg, #a8a8a8 95%, #545454 95%, #6d6969 100%);
    margin-left: 550px;
    margin-top: 150px;
    z-index: 200;
  }
  .g2-chart{
    width:600px;
    height:300px;
    margin-top:20px;
    margin-left:30px;
    background-color: #a8a8a8;
    
  }
  .people-sum{
    display: flex;
    align-items: center;
    justify-content: center
  }
  #close {
    font-size: 18px;
    position: absolute;
    top: 0;
    right: 5px;
    cursor: pointer;
  }</style>